Skip to main content
Announcements
Join us at Qlik Connect for 3 magical days of learning, networking,and inspiration! REGISTER TODAY and save!
cancel
Showing results for 
Search instead for 
Did you mean: 
snehasimha
Contributor III
Contributor III

Create Date Parameter

Dear All

I need to create two date Parameters ie From and To date using the functions. which  will give me the Sales for the chosen years.  The free trial of the App version is ceased and hence and i can only access the same in cloud.Request to please give me a step by step creation of the same. (using functions) no scripts please.

Also i need to calculate the Sales Growth for the Date parameters created.

 

Regards

Sneha Simha

11 Replies
rubenmarin

Hi, you can add two variable objects for the user to inser fron and to dates, or use a celndar object with ranged selections.

The expressions that uses variables could be: Sum({<DateField={">=$(FromVariable)<=$(ToVariable)"}>} Sales)

And with calendar you can use a simple: Sum(Sales)

About the growth... calculated based on what values? it would be better if you post sample data and the expected result.

 

snehasimha
Contributor III
Contributor III
Author

Hi 

I cant possibly share the data, i want two date parameters say one for last year and one for this year.The Growth should be calculated based on the Sales for both the years.

Without the code , is there a way to get the calendar generated like in Tableau

 

Regards

Sneha Simha

rubenmarin

Hi, I don't know Tableau, If you load ata using data manager a calendar is created automatically from the dates fields, one of this fields is the year.

Having Year as field to make selections, the expression could be:

(Sum({<Year={"$(=Max(Year))>} Sales)-(Sum({<Year={"$(=Min(Year))>} Sales))/Sum({<Year={"$(=Min(Year))>} Sales)

snehasimha
Contributor III
Contributor III
Author

Hi
My data is an excel sheet and I am using
a trail Version on the cloud. Hence I am finding it a little difficult. If
it's possible request you to kindly guide me step by step please.

--


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this email in error, please notify the
sender immediately by email or delete this email from your system. If you
are not the intended recipient, you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
information is strictly prohibited. The opinion expressed in this mail is
that of the sender and does not necessarily reflect that of Titan.


 ****


WARNING: Despite best possible precautionary measures taken by Titan
Company Limited, computer viruses can be transmitted via email. The
recipient should check and scan this email and any attachments for the
presence of viruses. Titan Company Limited accepts no liability for any
damage caused by any virus transmitted by this email.****


*******************************************************************************************************************
rubenmarin

Hi, there are different ways to load data, ther is a data manager, where you can select a column data, mark it as date field, and the calendar is created autoamticaly. Maybe you are no using this option because usually date fields are automaticaly marked.

The othre option is script editor, this is more flexible but you need to work with the script, in this case to create a year field from data you only need to a row:

LOAD <List of fields>,
  Year(DateField) as Year // this is the new row to add
FROM ...

 If doesn't works I will need more info, post your script, or some dummy data, or something... there are a lot of different ways to do the same, you need to provide more info about your current attemps to make this work..

snehasimha
Contributor III
Contributor III
Author

Hi
I will send my data in sometime, please do help me. I will change the
required fields and send across to you

--


This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they are
addressed. If you have received this email in error, please notify the
sender immediately by email or delete this email from your system. If you
are not the intended recipient, you are notified that disclosing, copying,
distributing or taking any action in reliance on the contents of this
information is strictly prohibited. The opinion expressed in this mail is
that of the sender and does not necessarily reflect that of Titan.


 ****


WARNING: Despite best possible precautionary measures taken by Titan
Company Limited, computer viruses can be transmitted via email. The
recipient should check and scan this email and any attachments for the
presence of viruses. Titan Company Limited accepts no liability for any
damage caused by any virus transmitted by this email.****


*******************************************************************************************************************
snehasimha
Contributor III
Contributor III
Author

Hi   Rubenmarin

 
 
Enclosed my sample data.Please do help me.Enclosed is the screen shot as to how I want my dates and the below tabulation comprises Values and Growth based on the dates above.
 
snehasimha_1-1644839112499.png

 

 
 

Regards

Sneha simha

 

chris_djih
Creator III
Creator III

You are may looking for the date picker.
You can find it under custom objects> Qlik Dashboard bundle:
grafik.png

If you found help, mark the correct answer and give some likes to ALL contributors, that tried to help.
rubenmarin

Hi, attached there is a sample to do this for sales, I'm using two date pickers as @chris_djih suggest.

Period 1 to default state and period 2 assigned to 'Comp' altern states.

You can create altern states in master items, this allows to use the same field with differnt slections

rubenmarin_0-1644867961684.png

To use selctions of the Comp alternstaet you can use set analysis, so the epxression would be:

- Period 1: Sum(SalesValue)

- Period 2(using altern state): Sum({Comp} SalesValue)

To calculate the group i'm using Column() function, you can also use column labels, master items or write the full expression: (Sum({Comp} SalesValue)-Sum(SalesValue))/Sum(SalesValue)