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

1 Solution

Accepted Solutions
Not applicable

If you have both dates in the same table you may create additional field calculated from those dates during reload.

Simple:

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

and then you will count on this CountDate.

You may also do similiar thing on the fly, using calculated dimension.

About IsCancelled flag='0' - use set analysis...

count({<IsCancelled={0}>}value)

regards

Darek

View solution in original post

17 Replies
Not applicable

Deepak,

You are talking about modifications. Please share the application you want to modify...


regards

Darek

deepakqlikview_123
Specialist
Specialist
Author

Hi Dariusz,

As application is too huge not able to share.

Can you please suggest how to count record in above mentioned case.

Thanks

Not applicable

It is difficult for me to answer your question if i cant see application, data model etc.

I uderstand, that in your qlikview table you have those data fields.

Having regard to the selection of the user you want to count the number of records in which at least one of these dates there? or maybe you want to count records with a specific first date as a first indicator and records that do not have a first date but they have other as yet another indicator?
Please describe in more detail at least your expectations. And the best Annex section of the application or .xls with sample data or anything that will allow clearly read your needs ...



regards
Darek

deepakqlikview_123
Specialist
Specialist
Author

Hi Dariusz,

I want to count first updatedon date and when updated on date is null 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

And you have those fields in the same table?

deepakqlikview_123
Specialist
Specialist
Author

Yes I have same fields in same table.

PrashantSangle

Hi,

When I read your discussion, I understand that you want to count Updated_On_Date

if it is null then you are counting invoice date.

Try this,

Create a flag field in your script as

if(isnull(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))

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 🙂
Not applicable

If you have both dates in the same table you may create additional field calculated from those dates during reload.

Simple:

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

and then you will count on this CountDate.

You may also do similiar thing on the fly, using calculated dimension.

About IsCancelled flag='0' - use set analysis...

count({<IsCancelled={0}>}value)

regards

Darek

deepakqlikview_123
Specialist
Specialist
Author

Hi Dariusz,

Can you pleasetell me what would be final expression I am still getting error.

Thanks