Unlock a world of possibilities! Login now and discover the exclusive benefits awaiting you.
Hi All,
I am new to qlikview i need your help on following issue .
I had date field and want to know how many days for today .
i had achived this using today()- Date where i am getting no.of days in between .
the days field looks like as follows
1 4 6 7 8 11 15 17 20 27 33 40 46 50 .
And i am using days dimension in a line chart.
My user wants dimension values as follows (using Days field )
<5 <10 <20 <40 <49 >50
Can you suggest me steps to achieve this .
Thanks
Uma ,
We can approach many ways
1) May be create field in Script Directly like
If(DaysField >=1 and DaysField <5, Dual('<5',1),
If(DaysField >=5 and DaysField <10, Dual('<10',2),
If(DaysField >=10 and DaysField <20, Dual('<20',3),
If(DaysField >=20 and DaysField <40, Dual('<40',4),
If(DaysField >=40 and DaysField <49, Dual('<49',5),
If(DaysField >=50 Dual('>50',1))))))) as FieldName
Note: You can use, Direct field as Dimension if you need
2) Class(DaysField, 10)
We can approach many ways
1) May be create field in Script Directly like
If(DaysField >=1 and DaysField <5, Dual('<5',1),
If(DaysField >=5 and DaysField <10, Dual('<10',2),
If(DaysField >=10 and DaysField <20, Dual('<20',3),
If(DaysField >=20 and DaysField <40, Dual('<40',4),
If(DaysField >=40 and DaysField <49, Dual('<49',5),
If(DaysField >=50 Dual('>50',1))))))) as FieldName
Note: You can use, Direct field as Dimension if you need
2) Class(DaysField, 10)
see this
hi umakanth242
Using above approach, <5 bucket will give you days between (1 to 5), but <10 bucket will give you days between( 6 to 10, which is correct? don't you think it should also include 1 to 5?)
Hi Kashal
For <5 should be >=0 to <5
<10 should be from >=5 to <10.
Similar to renaming as well
Thanks,
Uma
Hi Anil
Thanks for helping .