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: 
deepakqlikview_123
Specialist
Specialist

Getting records as per currect selection date

Hello All,

I have two fields in my database Updatedon date  and invoice date.

First of all I need to count record as per  updatedon date and if updatedon date not exists records as per count invoice date

I want to count all records in retail for respective month and year based on current selection month and year,


Can you please suggest at code level  what modifications are required for this.



Thanks

17 Replies
Not applicable

Deepak,

this is why it is difficult to help when i cant do it in your sample application

Having it, i can even do it for you. But if i have not it, i can only give you idea, how to do that ....

regards

Darek

deepakqlikview_123
Specialist
Specialist
Author

Hello All,

If value for updatedon date is '-' not null then how to proceed  below

I count first updatedon date and when updated on date is '-' then count as per invoice date.

Moreover there is also a flag field while counting I have to count all fields where IsCancelled flag='0'

Thanks,

deepakqlikview_123
Specialist
Specialist
Author

Hi,

If value for updatedon date is '-' not null then how to proceed  below

I count first updatedon date and when updated on date is '-' then count as per invoice date.

Moreover there is also a flag field while counting I have to count all fields where IsCancelled flag='0'

Thanks,

deepakqlikview_123
Specialist
Specialist
Author

Hi,

If value for updatedon date is '-' not null then how to proceed  below

I count first updatedon date and when updated on date is '-' then count as per invoice date.

Moreover there is also a flag field while counting I have to count all fields where IsCancelled flag='0'

Thanks,

Not applicable

Try this,

Create a flag field in your script as

if(isnull(Updated_On_Date) OR Updated_On_Date='-','true','false') as updated_On_Date_Flag;

Then In your chart write set analysis.

Like,

if(updated_On_Date_Flag="true",count({<updated_On_Date_Flag={"true"}>}Updated_On_Date),count(invoice_date))

credit max

deepakqlikview_123
Specialist
Specialist
Author

Hi All,

Please correct me if I am wrong,

if(isnull(UpdatedonDate), InvoiceDate, UpdatedonDate) as CountDate,

for counting countDate in same expression is it correct

count(if(isnull(UpdatedonDate), InvoiceDate, UpdatedonDate)  CountDate) as count,

Not applicable

You appear to be missing the OR statement

PrashantSangle

Hi,

Try this,

In above solution, there i need to do some change like below.

This will help you.

if(isnull(Updated_On_Date) OR Updated_On_Date='-' ,'true','false') as updated_On_Date_Flag;


then your set analysis is like,


if(updated_On_Date_Flag="false" and IsCancelled_flag='0' ,count({<updated_On_Date_Flag={"false"}>}Updated_On_Date),count(invoice_date))



Regards,


Great dreamer's dreams never fulfilled, they are always transcended.
Please appreciate our Qlik community members by giving Kudos for sharing their time for your query. If your query is answered, please mark the topic as resolved 🙂