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

Announcements
Qlik Open Lakehouse is Now Generally Available! Discover the key highlights and partner resources here.
cancel
Showing results for 
Search instead for 
Did you mean: 
Not applicable

count - formula

Hi guys!

I need one help...

I have this Formula: Count(distinct SalesOrderID)/Count(distinct total <DayTimeShiping> SalesOrderID)

it's working correct, but I have to set up with a date, that means: my result should show with  the current date of 30-June-2009, I have also on my Script: LET vTodayDate = num(MakeDate(2009,06,30)); //Today's Date

How can I put the Date in my formula? Have someone an idea?

Regards

Jenni

5 Replies
SunilChauhan
Champion II
Champion II

u  can write like this

Count( if(Datefiled=$(vTodaydate),SalesOrderid)/count(distinct total <dateTimeshipping>if(datefield=$(VToDayDate)salesorderid)

thanks

Sunil Chauhan

Sunil Chauhan
Not applicable
Author

Thanks Sunil!

Not applicable
Author

it's not working

I have this:

Count(if(Year=$(vCurrentYear),SalesOrderID)/Count(distinct total(if(Year=$(vCurrentYear),<DayTimeShiping>SalesOrderID))

SunilChauhan
Champion II
Champion II

can u share sample

Sunil Chauhan
Not applicable
Author

This is formula working, but it just show the current year of 2009,

Count({$<FinYear={$(=Max(FinYear))}>}distinct SalesOrderID)/Count({$<FinYear={$(=Max(FinYear))}>}distinct total <DayTimeShiping> SalesOrderID)

but with full Date--> Month(June), Year(2009) and Day(30), I cant do it with the  Variable "vTodayDate"

I put a sample....