Qlik Community

Ask a Question

New to QlikView

If you’re new to QlikView, start with this Discussion Board and get up-to-speed quickly.

Announcements
Talk to Experts Tuesday, January 26th at 10AM EST: Qlik Sense. REGISTER NOW
cancel
Showing results for 
Search instead for 
Did you mean: 
Partner
Partner

Variable based on date

Hello,

I have a chart and KPI is filtered based on dates selection (as in the screenshot).

I use two variables for beginning and end date selection. The problem is that the date selected is not well interpreted and thus no results in the chart. I checked and data is being present : I made a simple chart and used a date selection from a calendar object and it's working.

The question is what's wrong with the variables ?

Please find attached the example as a screenshot.

 

QV_pb_Date.png

 

1 Solution

Accepted Solutions

How about if you load it as Num(Date) as Date so that it is stored as a number...

View solution in original post

10 Replies

Are the values for the dates exactly in the date format expected? "24/07/2019" is a valid format, but so are "07/24/2019" or "43670".

According to the definition of the variable v_PC_DF the date will have the format "43670", so does the field "Date" have the same values stored?

May be change your variable to this

TimeStamp(Today(), 'DD/MM/YYYY hh:mm:ss')

I can't see the whole format for Date field, but make sure to use TT if you have AM, PM at the end.

Partner
Partner

@Miguel_Angel_Baeyens 

Hello,

Yes, the field Date has the same format 43670 in the qvd file. But when loaded in the application it changes as you can see in the simple chart above. QV must be doing some formatting which I want to avoid.

Partner
Partner

@sunny_talwar 

Actually, I don't want the timestamp. I would like to stick to simple number. And as I was explaining above, QV automatically considers the Date as Timestamp although in the qvd it's a number.

Check how it looks like when you use the field value or the variable in a text object, not in a chart. I'd expect it to show "43670", but might not be the case.

How about if you load it as Num(Date) as Date so that it is stored as a number...

View solution in original post

Partner
Partner

@sunny_talwar 

Num(Date) worked but I had to find all Date fields loaded and modify each one of them. Otherwise it doesn't work.

Thanks for your help !

I guess I am confused as to what exactly is the issue? I mean you need to have a single format for your date field to make it work in your set analysis... and you don't want to use Num()?

Partner
Partner

@sunny_talwar 

I used the Num() function and it worked. But since I have some other dates loaded with another format they all needed to be formatted with Num() :-).