Do not input private or sensitive data. View Qlik Privacy & Cookie Policy.
Skip to main content

Announcements
Q&A with Qlik - Qlik Cloud Migration: Questions about migrating to Qlik Cloud? Catch the latest replay!
cancel
Showing results for 
Search instead for 
Did you mean: 
prashantsanchet
Creator
Creator

Qlik set analysis

Hi Team,

Scenario:


  • One business date will be always selected
  • For that business date we are adding ITDSales value for Business Date= Last Year Last date + YTDSales value for current business date
  • I have plotted this with one bar chart having customer as dimension and measure as following. :

Total ITDSales  =

if( Sum([Discount])>=1000,


num(Sum({$<BusinessDate={'$(=date(yearend([BusinessDate],-1), 'MM/DD/YYYY'))'}>}[ITDSales]) + sum([YTDSales]),'#,##0')


)

  • I  want to count the only customer where Discount is greater  than 1000. for above measure in chart
  • I am writing below expression but i am not getting exact count .

Total Customer Count

Count({<[Customer] ={"=Sum([Discount])>=1000"} >} distinct Customer)


Could you please help on same



6 Replies
aunahsan
Partner - Contributor III
Partner - Contributor III

Count({<[Discount]={'>=1000'} >} distinct Customer)


The above expression is working for me, can you give it a go?

prashantsanchet
Creator
Creator
Author

Hi,

My expression need to be like this only because i do have customer having multiple discount amount and hence inner expression need to be like this

Count({<[Customer] ={"=Sum([Discount])>=1000"} >} distinct Customer)

sunny_talwar
MVP
MVP

What are you getting and what do you expect to get? Expression's syntax looks right, but difficult to say what might be wrong without having more details

prashantsanchet
Creator
Creator
Author

  • One business date will be always selected
  • For that business date we are adding ITDSales value for Business Date= Last Year Last date + YTDSales value for current business date
  • I have plotted this with one bar chart having customer as dimension and measure as following. :

Total ITDSales  = if( Sum([Discount])>=1000,
num(Sum({$<BusinessDate={'$(=date(yearend([BusinessDate],-1), 'MM/DD/YYYY'))'}>}[ITDSales]) + sum([YTDSales]),'#,##0')
)

  • I am counting the rows after export and  i want to show the Count in KPI
  • I am writing below expression but i am not getting exact count . It is showing count of all the customer . It is not showing count the only customer where Discount is greater  than 1000.

Total Customer Count

Count({<[Customer] ={"=Sum([Discount])>=1000"} >} distinct Customer)


I


sunny_talwar
MVP
MVP

May be try this

Count(Aggr(If(Sum([Discount]) >= 1000, Sum({$<BusinessDate = {'$(=Date(YearEnd([BusinessDate],-1), 'MM/DD/YYYY'))'}>} [ITDSales]) + Sum([YTDSales])), Customer))

sasiparupudi1
Master III
Master III

may be try

Count({<[Customer] ={"=Aggr(Sum([Discount]),[Customer])>=1000"} >} distinct Customer)