Skip to main content
Woohoo! Qlik Community has won “Best in Class Community” in the 2024 Khoros Kudos awards!
Announcements
Nov. 20th, Qlik Insider - Lakehouses: Driving the Future of Data & AI - PICK A SESSION
cancel
Showing results for 
Search instead for 
Did you mean: 
kkarlste
Creator
Creator

Sum skript table and sql varchar change tot date

 

Hi

It's sql table varchar

 

 




Hi

It's sql table varchar

kkarlste_3-1695617173417.png



This working Sum( {<MonthYear={'$(=MaxString(MonthYear))'}>} QC_EvaluationResult)
but there will be no years and months for the columns
Month year is varchar sql table. How do I change the script to varchar to date.
If after this the formula could sum the values ​​per month

kkarlste_0-1695616877676.png

 

 

Labels (1)
4 Replies
Aditya_Chitale
Specialist
Specialist

Use one of the expressions in Qlik Sense Script:

  1. Date(Date#(Year,'YYYY'),'YYYY') as Year_New
  2. num(num#(Year)) as Year_New

in your script to convert varchar Year to date format Year.

 

Regards,

Aditya

kkarlste
Creator
Creator
Author

Hi


Yes, but it needs to be included in this script

Sum( {<MonthYear={'$(=MaxString(MonthYear))'}>} QC_EvaluationResult)

Aditya_Chitale
Specialist
Specialist

If your field is in month-Year format, you will have to extract year part from it using script and then  you can use below set expression to show only  max(Year) sum values.

Sum({<Year={"$(=max(Year))"}>}QC_EvaluationResult)

 

Regards,

Aditya

kkarlste
Creator
Creator
Author

Sorry, but not working.
Sum({<Year={"$(=max(Year))"}>}QC_EvaluationResult)


kkarlste_2-1695646674971.png

YearKey is varchar sql database where this calender loading to Sense

kkarlste_4-1695646852429.png


And this is model what I Want show this data

kkarlste_3-1695646691009.png