Forum Discussion
Top N filter with computed N
I have "simple" challenge, but can't find a solution:
I have table of cases created over a time period.
This table is filtered for cases within a certain time period. From this subset I need to take a random sample. However, the sample size is dependent on the size of the (filtered) table:
Less than 10 cases -take 2 cases
Less than 100 cases - take 20%, at most 10
More than 100 cases - take 10%, at most 100
- The random sample part is easy (add column "rand", filled with RAND() and take top N filter)
But, how make that "N" dependent on the table size?
we figured out a different approach that works
5 Replies
- v-hashadapu
Community Support
Hi TBD56 , Thank you for reaching out to the Microsoft Community Forum.
Please let us know if your issue is solved. If it is, consider marking the answers that helped 'Accept as Solution', so others with similar queries can find them easily. If not, please share the details.
Thank you. - v-hashadapu
Community Support
Hi TBD56 , Please let us know if your issue is solved. If it is, consider marking the answer that helped 'Accept as Solution', so others with similar queries can find it easily. If not, please share the details.
Thank you.- TBD56New Member
we figured out a different approach that works
- v-hashadapu
Community Support
Hi TBD56 , We are pleased to hear that you have found a workaround that works. Kindly let us know if it successfully resolved your issue on permanent basis. If it did, please share the details here and mark it as 'Accept as solution' to assist others with similar problems. If it did not, please provide further details.
Thank you.